<?php

/**
 * OrderItem.
 *
 * PHP version 8.3
 *
 * @category Class
 *
 * @author   OpenAPI Generator team
 *
 * @see     https://openapi-generator.tech
 */

/**
 * Selling Partner API for Orders.
 *
 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
 *
 * The version of the OpenAPI document: v0
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.9.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace SpApi\Model\orders\v0;

use SpApi\Model\ModelInterface;
use SpApi\ObjectSerializer;

/**
 * OrderItem Class Doc Comment.
 *
 * @category Class
 *
 * @description A single order item.
 *
 * @author   OpenAPI Generator team
 *
 * @see     https://openapi-generator.tech
 *
 * @implements \ArrayAccess<string, mixed>
 */
class OrderItem implements ModelInterface, \ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

    public const DEEMED_RESELLER_CATEGORY_IOSS = 'IOSS';
    public const DEEMED_RESELLER_CATEGORY_UOSS = 'UOSS';

    /**
     * The original name of the model.
     */
    protected static string $openAPIModelName = 'OrderItem';

    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static array $openAPITypes = [
        'asin' => 'string',
        'seller_sku' => 'string',
        'order_item_id' => 'string',
        'associated_items' => '\SpApi\Model\orders\v0\AssociatedItem[]',
        'title' => 'string',
        'quantity_ordered' => 'int',
        'quantity_shipped' => 'int',
        'product_info' => '\SpApi\Model\orders\v0\ProductInfoDetail',
        'points_granted' => '\SpApi\Model\orders\v0\PointsGrantedDetail',
        'item_price' => '\SpApi\Model\orders\v0\Money',
        'shipping_price' => '\SpApi\Model\orders\v0\Money',
        'item_tax' => '\SpApi\Model\orders\v0\Money',
        'shipping_tax' => '\SpApi\Model\orders\v0\Money',
        'shipping_discount' => '\SpApi\Model\orders\v0\Money',
        'shipping_discount_tax' => '\SpApi\Model\orders\v0\Money',
        'promotion_discount' => '\SpApi\Model\orders\v0\Money',
        'promotion_discount_tax' => '\SpApi\Model\orders\v0\Money',
        'promotion_ids' => 'string[]',
        'cod_fee' => '\SpApi\Model\orders\v0\Money',
        'cod_fee_discount' => '\SpApi\Model\orders\v0\Money',
        'is_gift' => 'string',
        'condition_note' => 'string',
        'condition_id' => 'string',
        'condition_subtype_id' => 'string',
        'scheduled_delivery_start_date' => 'string',
        'scheduled_delivery_end_date' => 'string',
        'price_designation' => 'string',
        'tax_collection' => '\SpApi\Model\orders\v0\TaxCollection',
        'serial_number_required' => 'bool',
        'is_transparency' => 'bool',
        'ioss_number' => 'string',
        'store_chain_store_id' => 'string',
        'deemed_reseller_category' => 'string',
        'buyer_info' => '\SpApi\Model\orders\v0\ItemBuyerInfo',
        'buyer_requested_cancel' => '\SpApi\Model\orders\v0\BuyerRequestedCancel',
        'serial_numbers' => 'string[]',
        'substitution_preferences' => '\SpApi\Model\orders\v0\SubstitutionPreferences',
        'measurement' => '\SpApi\Model\orders\v0\Measurement',
        'shipping_constraints' => '\SpApi\Model\orders\v0\ShippingConstraints',
        'amazon_programs' => '\SpApi\Model\orders\v0\AmazonPrograms'];

    /**
     * Array of property to format mappings. Used for (de)serialization.
     *
     * @var string[]
     *
     * @phpstan-var array<string, string|null>
     *
     * @psalm-var array<string, string|null>
     */
    protected static array $openAPIFormats = [
        'asin' => null,
        'seller_sku' => null,
        'order_item_id' => null,
        'associated_items' => null,
        'title' => null,
        'quantity_ordered' => null,
        'quantity_shipped' => null,
        'product_info' => null,
        'points_granted' => null,
        'item_price' => null,
        'shipping_price' => null,
        'item_tax' => null,
        'shipping_tax' => null,
        'shipping_discount' => null,
        'shipping_discount_tax' => null,
        'promotion_discount' => null,
        'promotion_discount_tax' => null,
        'promotion_ids' => null,
        'cod_fee' => null,
        'cod_fee_discount' => null,
        'is_gift' => null,
        'condition_note' => null,
        'condition_id' => null,
        'condition_subtype_id' => null,
        'scheduled_delivery_start_date' => null,
        'scheduled_delivery_end_date' => null,
        'price_designation' => null,
        'tax_collection' => null,
        'serial_number_required' => null,
        'is_transparency' => null,
        'ioss_number' => null,
        'store_chain_store_id' => null,
        'deemed_reseller_category' => null,
        'buyer_info' => null,
        'buyer_requested_cancel' => null,
        'serial_numbers' => null,
        'substitution_preferences' => null,
        'measurement' => null,
        'shipping_constraints' => null,
        'amazon_programs' => null];

    /**
     * Array of nullable properties. Used for (de)serialization.
     *
     * @var bool[]
     */
    protected static array $openAPINullables = [
        'asin' => false,
        'seller_sku' => true,
        'order_item_id' => false,
        'associated_items' => true,
        'title' => true,
        'quantity_ordered' => false,
        'quantity_shipped' => true,
        'product_info' => true,
        'points_granted' => true,
        'item_price' => true,
        'shipping_price' => true,
        'item_tax' => true,
        'shipping_tax' => true,
        'shipping_discount' => true,
        'shipping_discount_tax' => true,
        'promotion_discount' => true,
        'promotion_discount_tax' => true,
        'promotion_ids' => true,
        'cod_fee' => true,
        'cod_fee_discount' => true,
        'is_gift' => true,
        'condition_note' => true,
        'condition_id' => true,
        'condition_subtype_id' => true,
        'scheduled_delivery_start_date' => true,
        'scheduled_delivery_end_date' => true,
        'price_designation' => true,
        'tax_collection' => true,
        'serial_number_required' => true,
        'is_transparency' => true,
        'ioss_number' => true,
        'store_chain_store_id' => true,
        'deemed_reseller_category' => true,
        'buyer_info' => true,
        'buyer_requested_cancel' => true,
        'serial_numbers' => true,
        'substitution_preferences' => true,
        'measurement' => true,
        'shipping_constraints' => true,
        'amazon_programs' => true,
    ];

    /**
     * If a nullable field gets set to null, insert it here.
     *
     * @var bool[]
     */
    protected array $openAPINullablesSetToNull = [];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name.
     *
     * @var string[]
     */
    protected static array $attributeMap = [
        'asin' => 'ASIN',
        'seller_sku' => 'SellerSKU',
        'order_item_id' => 'OrderItemId',
        'associated_items' => 'AssociatedItems',
        'title' => 'Title',
        'quantity_ordered' => 'QuantityOrdered',
        'quantity_shipped' => 'QuantityShipped',
        'product_info' => 'ProductInfo',
        'points_granted' => 'PointsGranted',
        'item_price' => 'ItemPrice',
        'shipping_price' => 'ShippingPrice',
        'item_tax' => 'ItemTax',
        'shipping_tax' => 'ShippingTax',
        'shipping_discount' => 'ShippingDiscount',
        'shipping_discount_tax' => 'ShippingDiscountTax',
        'promotion_discount' => 'PromotionDiscount',
        'promotion_discount_tax' => 'PromotionDiscountTax',
        'promotion_ids' => 'PromotionIds',
        'cod_fee' => 'CODFee',
        'cod_fee_discount' => 'CODFeeDiscount',
        'is_gift' => 'IsGift',
        'condition_note' => 'ConditionNote',
        'condition_id' => 'ConditionId',
        'condition_subtype_id' => 'ConditionSubtypeId',
        'scheduled_delivery_start_date' => 'ScheduledDeliveryStartDate',
        'scheduled_delivery_end_date' => 'ScheduledDeliveryEndDate',
        'price_designation' => 'PriceDesignation',
        'tax_collection' => 'TaxCollection',
        'serial_number_required' => 'SerialNumberRequired',
        'is_transparency' => 'IsTransparency',
        'ioss_number' => 'IossNumber',
        'store_chain_store_id' => 'StoreChainStoreId',
        'deemed_reseller_category' => 'DeemedResellerCategory',
        'buyer_info' => 'BuyerInfo',
        'buyer_requested_cancel' => 'BuyerRequestedCancel',
        'serial_numbers' => 'SerialNumbers',
        'substitution_preferences' => 'SubstitutionPreferences',
        'measurement' => 'Measurement',
        'shipping_constraints' => 'ShippingConstraints',
        'amazon_programs' => 'AmazonPrograms',
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     *
     * @var string[]
     */
    protected static array $setters = [
        'asin' => 'setAsin',
        'seller_sku' => 'setSellerSku',
        'order_item_id' => 'setOrderItemId',
        'associated_items' => 'setAssociatedItems',
        'title' => 'setTitle',
        'quantity_ordered' => 'setQuantityOrdered',
        'quantity_shipped' => 'setQuantityShipped',
        'product_info' => 'setProductInfo',
        'points_granted' => 'setPointsGranted',
        'item_price' => 'setItemPrice',
        'shipping_price' => 'setShippingPrice',
        'item_tax' => 'setItemTax',
        'shipping_tax' => 'setShippingTax',
        'shipping_discount' => 'setShippingDiscount',
        'shipping_discount_tax' => 'setShippingDiscountTax',
        'promotion_discount' => 'setPromotionDiscount',
        'promotion_discount_tax' => 'setPromotionDiscountTax',
        'promotion_ids' => 'setPromotionIds',
        'cod_fee' => 'setCodFee',
        'cod_fee_discount' => 'setCodFeeDiscount',
        'is_gift' => 'setIsGift',
        'condition_note' => 'setConditionNote',
        'condition_id' => 'setConditionId',
        'condition_subtype_id' => 'setConditionSubtypeId',
        'scheduled_delivery_start_date' => 'setScheduledDeliveryStartDate',
        'scheduled_delivery_end_date' => 'setScheduledDeliveryEndDate',
        'price_designation' => 'setPriceDesignation',
        'tax_collection' => 'setTaxCollection',
        'serial_number_required' => 'setSerialNumberRequired',
        'is_transparency' => 'setIsTransparency',
        'ioss_number' => 'setIossNumber',
        'store_chain_store_id' => 'setStoreChainStoreId',
        'deemed_reseller_category' => 'setDeemedResellerCategory',
        'buyer_info' => 'setBuyerInfo',
        'buyer_requested_cancel' => 'setBuyerRequestedCancel',
        'serial_numbers' => 'setSerialNumbers',
        'substitution_preferences' => 'setSubstitutionPreferences',
        'measurement' => 'setMeasurement',
        'shipping_constraints' => 'setShippingConstraints',
        'amazon_programs' => 'setAmazonPrograms',
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests).
     *
     * @var string[]
     */
    protected static array $getters = [
        'asin' => 'getAsin',
        'seller_sku' => 'getSellerSku',
        'order_item_id' => 'getOrderItemId',
        'associated_items' => 'getAssociatedItems',
        'title' => 'getTitle',
        'quantity_ordered' => 'getQuantityOrdered',
        'quantity_shipped' => 'getQuantityShipped',
        'product_info' => 'getProductInfo',
        'points_granted' => 'getPointsGranted',
        'item_price' => 'getItemPrice',
        'shipping_price' => 'getShippingPrice',
        'item_tax' => 'getItemTax',
        'shipping_tax' => 'getShippingTax',
        'shipping_discount' => 'getShippingDiscount',
        'shipping_discount_tax' => 'getShippingDiscountTax',
        'promotion_discount' => 'getPromotionDiscount',
        'promotion_discount_tax' => 'getPromotionDiscountTax',
        'promotion_ids' => 'getPromotionIds',
        'cod_fee' => 'getCodFee',
        'cod_fee_discount' => 'getCodFeeDiscount',
        'is_gift' => 'getIsGift',
        'condition_note' => 'getConditionNote',
        'condition_id' => 'getConditionId',
        'condition_subtype_id' => 'getConditionSubtypeId',
        'scheduled_delivery_start_date' => 'getScheduledDeliveryStartDate',
        'scheduled_delivery_end_date' => 'getScheduledDeliveryEndDate',
        'price_designation' => 'getPriceDesignation',
        'tax_collection' => 'getTaxCollection',
        'serial_number_required' => 'getSerialNumberRequired',
        'is_transparency' => 'getIsTransparency',
        'ioss_number' => 'getIossNumber',
        'store_chain_store_id' => 'getStoreChainStoreId',
        'deemed_reseller_category' => 'getDeemedResellerCategory',
        'buyer_info' => 'getBuyerInfo',
        'buyer_requested_cancel' => 'getBuyerRequestedCancel',
        'serial_numbers' => 'getSerialNumbers',
        'substitution_preferences' => 'getSubstitutionPreferences',
        'measurement' => 'getMeasurement',
        'shipping_constraints' => 'getShippingConstraints',
        'amazon_programs' => 'getAmazonPrograms',
    ];

    /**
     * Associative array for storing property values.
     */
    protected array $container = [];

    /**
     * Constructor.
     *
     * @param null|array $data Associated array of property values
     *                         initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->setIfExists('asin', $data ?? [], null);
        $this->setIfExists('seller_sku', $data ?? [], null);
        $this->setIfExists('order_item_id', $data ?? [], null);
        $this->setIfExists('associated_items', $data ?? [], null);
        $this->setIfExists('title', $data ?? [], null);
        $this->setIfExists('quantity_ordered', $data ?? [], null);
        $this->setIfExists('quantity_shipped', $data ?? [], null);
        $this->setIfExists('product_info', $data ?? [], null);
        $this->setIfExists('points_granted', $data ?? [], null);
        $this->setIfExists('item_price', $data ?? [], null);
        $this->setIfExists('shipping_price', $data ?? [], null);
        $this->setIfExists('item_tax', $data ?? [], null);
        $this->setIfExists('shipping_tax', $data ?? [], null);
        $this->setIfExists('shipping_discount', $data ?? [], null);
        $this->setIfExists('shipping_discount_tax', $data ?? [], null);
        $this->setIfExists('promotion_discount', $data ?? [], null);
        $this->setIfExists('promotion_discount_tax', $data ?? [], null);
        $this->setIfExists('promotion_ids', $data ?? [], null);
        $this->setIfExists('cod_fee', $data ?? [], null);
        $this->setIfExists('cod_fee_discount', $data ?? [], null);
        $this->setIfExists('is_gift', $data ?? [], null);
        $this->setIfExists('condition_note', $data ?? [], null);
        $this->setIfExists('condition_id', $data ?? [], null);
        $this->setIfExists('condition_subtype_id', $data ?? [], null);
        $this->setIfExists('scheduled_delivery_start_date', $data ?? [], null);
        $this->setIfExists('scheduled_delivery_end_date', $data ?? [], null);
        $this->setIfExists('price_designation', $data ?? [], null);
        $this->setIfExists('tax_collection', $data ?? [], null);
        $this->setIfExists('serial_number_required', $data ?? [], null);
        $this->setIfExists('is_transparency', $data ?? [], null);
        $this->setIfExists('ioss_number', $data ?? [], null);
        $this->setIfExists('store_chain_store_id', $data ?? [], null);
        $this->setIfExists('deemed_reseller_category', $data ?? [], null);
        $this->setIfExists('buyer_info', $data ?? [], null);
        $this->setIfExists('buyer_requested_cancel', $data ?? [], null);
        $this->setIfExists('serial_numbers', $data ?? [], null);
        $this->setIfExists('substitution_preferences', $data ?? [], null);
        $this->setIfExists('measurement', $data ?? [], null);
        $this->setIfExists('shipping_constraints', $data ?? [], null);
        $this->setIfExists('amazon_programs', $data ?? [], null);
    }

    /**
     * Gets the string presentation of the object.
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }

    /**
     * Array of property to type mappings. Used for (de)serialization.
     */
    public static function openAPITypes(): array
    {
        return self::$openAPITypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization.
     */
    public static function openAPIFormats(): array
    {
        return self::$openAPIFormats;
    }

    /**
     * Checks if a property is nullable.
     */
    public static function isNullable(string $property): bool
    {
        return self::openAPINullables()[$property] ?? false;
    }

    /**
     * Checks if a nullable property is set to null.
     */
    public function isNullableSetToNull(string $property): bool
    {
        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name.
     */
    public static function attributeMap(): array
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     */
    public static function setters(): array
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests).
     */
    public static function getters(): array
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     */
    public function getModelName(): string
    {
        return self::$openAPIModelName;
    }

    /**
     * Gets allowable values of the enum.
     *
     * @return string[]
     */
    public function getDeemedResellerCategoryAllowableValues(): array
    {
        return [
            self::DEEMED_RESELLER_CATEGORY_IOSS,
            self::DEEMED_RESELLER_CATEGORY_UOSS,
        ];
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties(): array
    {
        $invalidProperties = [];

        if (null === $this->container['asin']) {
            $invalidProperties[] = "'asin' can't be null";
        }
        if (null === $this->container['order_item_id']) {
            $invalidProperties[] = "'order_item_id' can't be null";
        }
        if (null === $this->container['quantity_ordered']) {
            $invalidProperties[] = "'quantity_ordered' can't be null";
        }
        $allowedValues = $this->getDeemedResellerCategoryAllowableValues();
        if (!is_null($this->container['deemed_reseller_category']) && !in_array($this->container['deemed_reseller_category'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'deemed_reseller_category', must be one of '%s'",
                $this->container['deemed_reseller_category'],
                implode("', '", $allowedValues)
            );
        }

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed.
     *
     * @return bool True if all properties are valid
     */
    public function valid(): bool
    {
        return 0 === count($this->listInvalidProperties());
    }

    /**
     * Gets asin.
     */
    public function getAsin(): string
    {
        return $this->container['asin'];
    }

    /**
     * Sets asin.
     *
     * @param string $asin the item's Amazon Standard Identification Number (ASIN)
     */
    public function setAsin(string $asin): self
    {
        if (is_null($asin)) {
            throw new \InvalidArgumentException('non-nullable asin cannot be null');
        }
        $this->container['asin'] = $asin;

        return $this;
    }

    /**
     * Gets seller_sku.
     */
    public function getSellerSku(): ?string
    {
        return $this->container['seller_sku'];
    }

    /**
     * Sets seller_sku.
     *
     * @param null|string $seller_sku the item's seller stock keeping unit (SKU)
     */
    public function setSellerSku(?string $seller_sku): self
    {
        if (is_null($seller_sku)) {
            array_push($this->openAPINullablesSetToNull, 'seller_sku');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('seller_sku', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['seller_sku'] = $seller_sku;

        return $this;
    }

    /**
     * Gets order_item_id.
     */
    public function getOrderItemId(): string
    {
        return $this->container['order_item_id'];
    }

    /**
     * Sets order_item_id.
     *
     * @param string $order_item_id an Amazon-defined order item identifier
     */
    public function setOrderItemId(string $order_item_id): self
    {
        if (is_null($order_item_id)) {
            throw new \InvalidArgumentException('non-nullable order_item_id cannot be null');
        }
        $this->container['order_item_id'] = $order_item_id;

        return $this;
    }

    /**
     * Gets associated_items.
     */
    public function getAssociatedItems(): ?array
    {
        return $this->container['associated_items'];
    }

    /**
     * Sets associated_items.
     *
     * @param null|array $associated_items A list of associated items that a customer has purchased with a product. For example, a tire installation service purchased with tires.
     */
    public function setAssociatedItems(?array $associated_items): self
    {
        if (is_null($associated_items)) {
            array_push($this->openAPINullablesSetToNull, 'associated_items');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('associated_items', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['associated_items'] = $associated_items;

        return $this;
    }

    /**
     * Gets title.
     */
    public function getTitle(): ?string
    {
        return $this->container['title'];
    }

    /**
     * Sets title.
     *
     * @param null|string $title the item's name
     */
    public function setTitle(?string $title): self
    {
        if (is_null($title)) {
            array_push($this->openAPINullablesSetToNull, 'title');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('title', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['title'] = $title;

        return $this;
    }

    /**
     * Gets quantity_ordered.
     */
    public function getQuantityOrdered(): int
    {
        return $this->container['quantity_ordered'];
    }

    /**
     * Sets quantity_ordered.
     *
     * @param int $quantity_ordered the number of items in the order
     */
    public function setQuantityOrdered(int $quantity_ordered): self
    {
        if (is_null($quantity_ordered)) {
            throw new \InvalidArgumentException('non-nullable quantity_ordered cannot be null');
        }
        $this->container['quantity_ordered'] = $quantity_ordered;

        return $this;
    }

    /**
     * Gets quantity_shipped.
     */
    public function getQuantityShipped(): ?int
    {
        return $this->container['quantity_shipped'];
    }

    /**
     * Sets quantity_shipped.
     *
     * @param null|int $quantity_shipped the number of items shipped
     */
    public function setQuantityShipped(?int $quantity_shipped): self
    {
        if (is_null($quantity_shipped)) {
            array_push($this->openAPINullablesSetToNull, 'quantity_shipped');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('quantity_shipped', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['quantity_shipped'] = $quantity_shipped;

        return $this;
    }

    /**
     * Gets product_info.
     */
    public function getProductInfo(): ?ProductInfoDetail
    {
        return $this->container['product_info'];
    }

    /**
     * Sets product_info.
     *
     * @param null|ProductInfoDetail $product_info product_info
     */
    public function setProductInfo(?ProductInfoDetail $product_info): self
    {
        if (is_null($product_info)) {
            array_push($this->openAPINullablesSetToNull, 'product_info');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('product_info', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['product_info'] = $product_info;

        return $this;
    }

    /**
     * Gets points_granted.
     */
    public function getPointsGranted(): ?PointsGrantedDetail
    {
        return $this->container['points_granted'];
    }

    /**
     * Sets points_granted.
     *
     * @param null|PointsGrantedDetail $points_granted points_granted
     */
    public function setPointsGranted(?PointsGrantedDetail $points_granted): self
    {
        if (is_null($points_granted)) {
            array_push($this->openAPINullablesSetToNull, 'points_granted');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('points_granted', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['points_granted'] = $points_granted;

        return $this;
    }

    /**
     * Gets item_price.
     */
    public function getItemPrice(): ?Money
    {
        return $this->container['item_price'];
    }

    /**
     * Sets item_price.
     *
     * @param null|Money $item_price item_price
     */
    public function setItemPrice(?Money $item_price): self
    {
        if (is_null($item_price)) {
            array_push($this->openAPINullablesSetToNull, 'item_price');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('item_price', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['item_price'] = $item_price;

        return $this;
    }

    /**
     * Gets shipping_price.
     */
    public function getShippingPrice(): ?Money
    {
        return $this->container['shipping_price'];
    }

    /**
     * Sets shipping_price.
     *
     * @param null|Money $shipping_price shipping_price
     */
    public function setShippingPrice(?Money $shipping_price): self
    {
        if (is_null($shipping_price)) {
            array_push($this->openAPINullablesSetToNull, 'shipping_price');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('shipping_price', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['shipping_price'] = $shipping_price;

        return $this;
    }

    /**
     * Gets item_tax.
     */
    public function getItemTax(): ?Money
    {
        return $this->container['item_tax'];
    }

    /**
     * Sets item_tax.
     *
     * @param null|Money $item_tax item_tax
     */
    public function setItemTax(?Money $item_tax): self
    {
        if (is_null($item_tax)) {
            array_push($this->openAPINullablesSetToNull, 'item_tax');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('item_tax', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['item_tax'] = $item_tax;

        return $this;
    }

    /**
     * Gets shipping_tax.
     */
    public function getShippingTax(): ?Money
    {
        return $this->container['shipping_tax'];
    }

    /**
     * Sets shipping_tax.
     *
     * @param null|Money $shipping_tax shipping_tax
     */
    public function setShippingTax(?Money $shipping_tax): self
    {
        if (is_null($shipping_tax)) {
            array_push($this->openAPINullablesSetToNull, 'shipping_tax');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('shipping_tax', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['shipping_tax'] = $shipping_tax;

        return $this;
    }

    /**
     * Gets shipping_discount.
     */
    public function getShippingDiscount(): ?Money
    {
        return $this->container['shipping_discount'];
    }

    /**
     * Sets shipping_discount.
     *
     * @param null|Money $shipping_discount shipping_discount
     */
    public function setShippingDiscount(?Money $shipping_discount): self
    {
        if (is_null($shipping_discount)) {
            array_push($this->openAPINullablesSetToNull, 'shipping_discount');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('shipping_discount', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['shipping_discount'] = $shipping_discount;

        return $this;
    }

    /**
     * Gets shipping_discount_tax.
     */
    public function getShippingDiscountTax(): ?Money
    {
        return $this->container['shipping_discount_tax'];
    }

    /**
     * Sets shipping_discount_tax.
     *
     * @param null|Money $shipping_discount_tax shipping_discount_tax
     */
    public function setShippingDiscountTax(?Money $shipping_discount_tax): self
    {
        if (is_null($shipping_discount_tax)) {
            array_push($this->openAPINullablesSetToNull, 'shipping_discount_tax');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('shipping_discount_tax', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['shipping_discount_tax'] = $shipping_discount_tax;

        return $this;
    }

    /**
     * Gets promotion_discount.
     */
    public function getPromotionDiscount(): ?Money
    {
        return $this->container['promotion_discount'];
    }

    /**
     * Sets promotion_discount.
     *
     * @param null|Money $promotion_discount promotion_discount
     */
    public function setPromotionDiscount(?Money $promotion_discount): self
    {
        if (is_null($promotion_discount)) {
            array_push($this->openAPINullablesSetToNull, 'promotion_discount');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('promotion_discount', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['promotion_discount'] = $promotion_discount;

        return $this;
    }

    /**
     * Gets promotion_discount_tax.
     */
    public function getPromotionDiscountTax(): ?Money
    {
        return $this->container['promotion_discount_tax'];
    }

    /**
     * Sets promotion_discount_tax.
     *
     * @param null|Money $promotion_discount_tax promotion_discount_tax
     */
    public function setPromotionDiscountTax(?Money $promotion_discount_tax): self
    {
        if (is_null($promotion_discount_tax)) {
            array_push($this->openAPINullablesSetToNull, 'promotion_discount_tax');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('promotion_discount_tax', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['promotion_discount_tax'] = $promotion_discount_tax;

        return $this;
    }

    /**
     * Gets promotion_ids.
     */
    public function getPromotionIds(): ?array
    {
        return $this->container['promotion_ids'];
    }

    /**
     * Sets promotion_ids.
     *
     * @param null|array $promotion_ids a list of promotion identifiers provided by the seller when the promotions were created
     */
    public function setPromotionIds(?array $promotion_ids): self
    {
        if (is_null($promotion_ids)) {
            array_push($this->openAPINullablesSetToNull, 'promotion_ids');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('promotion_ids', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['promotion_ids'] = $promotion_ids;

        return $this;
    }

    /**
     * Gets cod_fee.
     */
    public function getCodFee(): ?Money
    {
        return $this->container['cod_fee'];
    }

    /**
     * Sets cod_fee.
     *
     * @param null|Money $cod_fee cod_fee
     */
    public function setCodFee(?Money $cod_fee): self
    {
        if (is_null($cod_fee)) {
            array_push($this->openAPINullablesSetToNull, 'cod_fee');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('cod_fee', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['cod_fee'] = $cod_fee;

        return $this;
    }

    /**
     * Gets cod_fee_discount.
     */
    public function getCodFeeDiscount(): ?Money
    {
        return $this->container['cod_fee_discount'];
    }

    /**
     * Sets cod_fee_discount.
     *
     * @param null|Money $cod_fee_discount cod_fee_discount
     */
    public function setCodFeeDiscount(?Money $cod_fee_discount): self
    {
        if (is_null($cod_fee_discount)) {
            array_push($this->openAPINullablesSetToNull, 'cod_fee_discount');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('cod_fee_discount', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['cod_fee_discount'] = $cod_fee_discount;

        return $this;
    }

    /**
     * Gets is_gift.
     */
    public function getIsGift(): ?string
    {
        return $this->container['is_gift'];
    }

    /**
     * Sets is_gift.
     *
     * @param null|string $is_gift Indicates whether the item is a gift.  **Possible values**: `true` and `false`.
     */
    public function setIsGift(?string $is_gift): self
    {
        if (is_null($is_gift)) {
            array_push($this->openAPINullablesSetToNull, 'is_gift');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('is_gift', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['is_gift'] = $is_gift;

        return $this;
    }

    /**
     * Gets condition_note.
     */
    public function getConditionNote(): ?string
    {
        return $this->container['condition_note'];
    }

    /**
     * Sets condition_note.
     *
     * @param null|string $condition_note the condition of the item, as described by the seller
     */
    public function setConditionNote(?string $condition_note): self
    {
        if (is_null($condition_note)) {
            array_push($this->openAPINullablesSetToNull, 'condition_note');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('condition_note', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['condition_note'] = $condition_note;

        return $this;
    }

    /**
     * Gets condition_id.
     */
    public function getConditionId(): ?string
    {
        return $this->container['condition_id'];
    }

    /**
     * Sets condition_id.
     *
     * @param null|string $condition_id The condition of the item.  **Possible values**: `New`, `Used`, `Collectible`, `Refurbished`, `Preorder`, and `Club`.
     */
    public function setConditionId(?string $condition_id): self
    {
        if (is_null($condition_id)) {
            array_push($this->openAPINullablesSetToNull, 'condition_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('condition_id', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['condition_id'] = $condition_id;

        return $this;
    }

    /**
     * Gets condition_subtype_id.
     */
    public function getConditionSubtypeId(): ?string
    {
        return $this->container['condition_subtype_id'];
    }

    /**
     * Sets condition_subtype_id.
     *
     * @param null|string $condition_subtype_id The subcondition of the item.  **Possible values**: `New`, `Mint`, `Very Good`, `Good`, `Acceptable`, `Poor`, `Club`, `OEM`, `Warranty`, `Refurbished Warranty`, `Refurbished`, `Open Box`, `Any`, and `Other`.
     */
    public function setConditionSubtypeId(?string $condition_subtype_id): self
    {
        if (is_null($condition_subtype_id)) {
            array_push($this->openAPINullablesSetToNull, 'condition_subtype_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('condition_subtype_id', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['condition_subtype_id'] = $condition_subtype_id;

        return $this;
    }

    /**
     * Gets scheduled_delivery_start_date.
     */
    public function getScheduledDeliveryStartDate(): ?string
    {
        return $this->container['scheduled_delivery_start_date'];
    }

    /**
     * Sets scheduled_delivery_start_date.
     *
     * @param null|string $scheduled_delivery_start_date The start date of the scheduled delivery window in the time zone for the order destination. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format.
     */
    public function setScheduledDeliveryStartDate(?string $scheduled_delivery_start_date): self
    {
        if (is_null($scheduled_delivery_start_date)) {
            array_push($this->openAPINullablesSetToNull, 'scheduled_delivery_start_date');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('scheduled_delivery_start_date', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['scheduled_delivery_start_date'] = $scheduled_delivery_start_date;

        return $this;
    }

    /**
     * Gets scheduled_delivery_end_date.
     */
    public function getScheduledDeliveryEndDate(): ?string
    {
        return $this->container['scheduled_delivery_end_date'];
    }

    /**
     * Sets scheduled_delivery_end_date.
     *
     * @param null|string $scheduled_delivery_end_date The end date of the scheduled delivery window in the time zone for the order destination. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format.
     */
    public function setScheduledDeliveryEndDate(?string $scheduled_delivery_end_date): self
    {
        if (is_null($scheduled_delivery_end_date)) {
            array_push($this->openAPINullablesSetToNull, 'scheduled_delivery_end_date');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('scheduled_delivery_end_date', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['scheduled_delivery_end_date'] = $scheduled_delivery_end_date;

        return $this;
    }

    /**
     * Gets price_designation.
     */
    public function getPriceDesignation(): ?string
    {
        return $this->container['price_designation'];
    }

    /**
     * Sets price_designation.
     *
     * @param null|string $price_designation Indicates that the selling price is a special price that is only available for Amazon Business orders. For more information about the Amazon Business Seller Program, refer to the [Amazon Business website](https://www.amazon.com/b2b/info/amazon-business).   **Possible values**: `BusinessPrice`
     */
    public function setPriceDesignation(?string $price_designation): self
    {
        if (is_null($price_designation)) {
            array_push($this->openAPINullablesSetToNull, 'price_designation');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('price_designation', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['price_designation'] = $price_designation;

        return $this;
    }

    /**
     * Gets tax_collection.
     */
    public function getTaxCollection(): ?TaxCollection
    {
        return $this->container['tax_collection'];
    }

    /**
     * Sets tax_collection.
     *
     * @param null|TaxCollection $tax_collection tax_collection
     */
    public function setTaxCollection(?TaxCollection $tax_collection): self
    {
        if (is_null($tax_collection)) {
            array_push($this->openAPINullablesSetToNull, 'tax_collection');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('tax_collection', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['tax_collection'] = $tax_collection;

        return $this;
    }

    /**
     * Gets serial_number_required.
     */
    public function getSerialNumberRequired(): ?bool
    {
        return $this->container['serial_number_required'];
    }

    /**
     * Sets serial_number_required.
     *
     * @param null|bool $serial_number_required When true, the product type for this item has a serial number.   Only returned for Amazon Easy Ship orders.
     */
    public function setSerialNumberRequired(?bool $serial_number_required): self
    {
        if (is_null($serial_number_required)) {
            array_push($this->openAPINullablesSetToNull, 'serial_number_required');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('serial_number_required', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['serial_number_required'] = $serial_number_required;

        return $this;
    }

    /**
     * Gets is_transparency.
     */
    public function getIsTransparency(): ?bool
    {
        return $this->container['is_transparency'];
    }

    /**
     * Sets is_transparency.
     *
     * @param null|bool $is_transparency When true, the ASIN is enrolled in Transparency. The Transparency serial number that you must submit is determined by:  **1D or 2D Barcode:** This has a **T** logo. Submit either the 29-character alpha-numeric identifier beginning with **AZ** or **ZA**, or the 38-character Serialized Global Trade Item Number (SGTIN). **2D Barcode SN:** Submit the 7- to 20-character serial number barcode, which likely has the prefix **SN**. The serial number is applied to the same side of the packaging as the GTIN (UPC/EAN/ISBN) barcode. **QR code SN:** Submit the URL that the QR code generates.
     */
    public function setIsTransparency(?bool $is_transparency): self
    {
        if (is_null($is_transparency)) {
            array_push($this->openAPINullablesSetToNull, 'is_transparency');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('is_transparency', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['is_transparency'] = $is_transparency;

        return $this;
    }

    /**
     * Gets ioss_number.
     */
    public function getIossNumber(): ?string
    {
        return $this->container['ioss_number'];
    }

    /**
     * Sets ioss_number.
     *
     * @param null|string $ioss_number The IOSS number of the marketplace. Sellers shipping to the EU from outside the EU must provide this IOSS number to their carrier when Amazon has collected the VAT on the sale.
     */
    public function setIossNumber(?string $ioss_number): self
    {
        if (is_null($ioss_number)) {
            array_push($this->openAPINullablesSetToNull, 'ioss_number');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('ioss_number', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['ioss_number'] = $ioss_number;

        return $this;
    }

    /**
     * Gets store_chain_store_id.
     */
    public function getStoreChainStoreId(): ?string
    {
        return $this->container['store_chain_store_id'];
    }

    /**
     * Sets store_chain_store_id.
     *
     * @param null|string $store_chain_store_id The store chain store identifier. Linked to a specific store in a store chain.
     */
    public function setStoreChainStoreId(?string $store_chain_store_id): self
    {
        if (is_null($store_chain_store_id)) {
            array_push($this->openAPINullablesSetToNull, 'store_chain_store_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('store_chain_store_id', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['store_chain_store_id'] = $store_chain_store_id;

        return $this;
    }

    /**
     * Gets deemed_reseller_category.
     */
    public function getDeemedResellerCategory(): ?string
    {
        return $this->container['deemed_reseller_category'];
    }

    /**
     * Sets deemed_reseller_category.
     *
     * @param null|string $deemed_reseller_category The category of deemed reseller. This applies to selling partners that are not based in the EU and is used to help them meet the VAT Deemed Reseller tax laws in the EU and UK.
     */
    public function setDeemedResellerCategory(?string $deemed_reseller_category): self
    {
        if (is_null($deemed_reseller_category)) {
            array_push($this->openAPINullablesSetToNull, 'deemed_reseller_category');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('deemed_reseller_category', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $allowedValues = $this->getDeemedResellerCategoryAllowableValues();
        if (!is_null($deemed_reseller_category) && !in_array($deemed_reseller_category, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'deemed_reseller_category', must be one of '%s'",
                    $deemed_reseller_category,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['deemed_reseller_category'] = $deemed_reseller_category;

        return $this;
    }

    /**
     * Gets buyer_info.
     */
    public function getBuyerInfo(): ?ItemBuyerInfo
    {
        return $this->container['buyer_info'];
    }

    /**
     * Sets buyer_info.
     *
     * @param null|ItemBuyerInfo $buyer_info buyer_info
     */
    public function setBuyerInfo(?ItemBuyerInfo $buyer_info): self
    {
        if (is_null($buyer_info)) {
            array_push($this->openAPINullablesSetToNull, 'buyer_info');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('buyer_info', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['buyer_info'] = $buyer_info;

        return $this;
    }

    /**
     * Gets buyer_requested_cancel.
     */
    public function getBuyerRequestedCancel(): ?BuyerRequestedCancel
    {
        return $this->container['buyer_requested_cancel'];
    }

    /**
     * Sets buyer_requested_cancel.
     *
     * @param null|BuyerRequestedCancel $buyer_requested_cancel buyer_requested_cancel
     */
    public function setBuyerRequestedCancel(?BuyerRequestedCancel $buyer_requested_cancel): self
    {
        if (is_null($buyer_requested_cancel)) {
            array_push($this->openAPINullablesSetToNull, 'buyer_requested_cancel');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('buyer_requested_cancel', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['buyer_requested_cancel'] = $buyer_requested_cancel;

        return $this;
    }

    /**
     * Gets serial_numbers.
     */
    public function getSerialNumbers(): ?array
    {
        return $this->container['serial_numbers'];
    }

    /**
     * Sets serial_numbers.
     *
     * @param null|array $serial_numbers A list of serial numbers for electronic products that are shipped to customers. Returned for FBA orders only.
     */
    public function setSerialNumbers(?array $serial_numbers): self
    {
        if (is_null($serial_numbers)) {
            array_push($this->openAPINullablesSetToNull, 'serial_numbers');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('serial_numbers', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['serial_numbers'] = $serial_numbers;

        return $this;
    }

    /**
     * Gets substitution_preferences.
     */
    public function getSubstitutionPreferences(): ?SubstitutionPreferences
    {
        return $this->container['substitution_preferences'];
    }

    /**
     * Sets substitution_preferences.
     *
     * @param null|SubstitutionPreferences $substitution_preferences substitution_preferences
     */
    public function setSubstitutionPreferences(?SubstitutionPreferences $substitution_preferences): self
    {
        if (is_null($substitution_preferences)) {
            array_push($this->openAPINullablesSetToNull, 'substitution_preferences');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('substitution_preferences', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['substitution_preferences'] = $substitution_preferences;

        return $this;
    }

    /**
     * Gets measurement.
     */
    public function getMeasurement(): ?Measurement
    {
        return $this->container['measurement'];
    }

    /**
     * Sets measurement.
     *
     * @param null|Measurement $measurement measurement
     */
    public function setMeasurement(?Measurement $measurement): self
    {
        if (is_null($measurement)) {
            array_push($this->openAPINullablesSetToNull, 'measurement');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('measurement', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['measurement'] = $measurement;

        return $this;
    }

    /**
     * Gets shipping_constraints.
     */
    public function getShippingConstraints(): ?ShippingConstraints
    {
        return $this->container['shipping_constraints'];
    }

    /**
     * Sets shipping_constraints.
     *
     * @param null|ShippingConstraints $shipping_constraints shipping_constraints
     */
    public function setShippingConstraints(?ShippingConstraints $shipping_constraints): self
    {
        if (is_null($shipping_constraints)) {
            array_push($this->openAPINullablesSetToNull, 'shipping_constraints');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('shipping_constraints', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['shipping_constraints'] = $shipping_constraints;

        return $this;
    }

    /**
     * Gets amazon_programs.
     */
    public function getAmazonPrograms(): ?AmazonPrograms
    {
        return $this->container['amazon_programs'];
    }

    /**
     * Sets amazon_programs.
     *
     * @param null|AmazonPrograms $amazon_programs amazon_programs
     */
    public function setAmazonPrograms(?AmazonPrograms $amazon_programs): self
    {
        if (is_null($amazon_programs)) {
            array_push($this->openAPINullablesSetToNull, 'amazon_programs');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('amazon_programs', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['amazon_programs'] = $amazon_programs;

        return $this;
    }

    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param int $offset Offset
     */
    public function offsetExists($offset): bool
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param int $offset Offset
     *
     * @return null|mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset): mixed
    {
        return $this->container[$offset] ?? null;
    }

    /**
     * Sets value based on offset.
     *
     * @param null|int $offset Offset
     * @param mixed    $value  Value to be set
     */
    public function offsetSet($offset, mixed $value): void
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param int $offset Offset
     */
    public function offsetUnset($offset): void
    {
        unset($this->container[$offset]);
    }

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     *
     * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php
     *
     * @return mixed returns data which can be serialized by json_encode(), which is a value
     *               of any type other than a resource
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize(): mixed
    {
        return ObjectSerializer::sanitizeForSerialization($this);
    }

    /**
     * Gets a header-safe presentation of the object.
     */
    public function toHeaderValue(): string
    {
        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }

    /**
     * Array of nullable properties.
     */
    protected static function openAPINullables(): array
    {
        return self::$openAPINullables;
    }

    /**
     * Array of nullable field names deliberately set to null.
     *
     * @return bool[]
     */
    private function getOpenAPINullablesSetToNull(): array
    {
        return $this->openAPINullablesSetToNull;
    }

    /**
     * Setter - Array of nullable field names deliberately set to null.
     *
     * @param bool[] $openAPINullablesSetToNull
     */
    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
    {
        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
    }

    /**
     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
     * $this->openAPINullablesSetToNull array.
     *
     * @param mixed $defaultValue
     */
    private function setIfExists(string $variableName, array $fields, $defaultValue): void
    {
        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
            $this->openAPINullablesSetToNull[] = $variableName;
        }

        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
    }
}
